From: Edward Yang Date: Wed, 18 Oct 2017 06:39:49 +0000 (-0500) Subject: Update docs to use cc instead of gcc X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~5^2~37^2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=209513d8991e05049c1e78c6cdf14c0865f2dd16;p=cargo.git Update docs to use cc instead of gcc --- diff --git a/src/doc/build-script.md b/src/doc/build-script.md index e4e528646..1a311915c 100644 --- a/src/doc/build-script.md +++ b/src/doc/build-script.md @@ -372,24 +372,26 @@ portable, and standardized. For example, the build script could be written as: ```rust,ignore // build.rs -// Bring in a dependency on an externally maintained `gcc` package which manages +// Bring in a dependency on an externally maintained `cc` package which manages // invoking the C compiler. -extern crate gcc; +extern crate cc; fn main() { - gcc::compile_library("libhello.a", &["src/hello.c"]); + cc::Build::new() + .file("src/hello.c") + .compile("hello"); } ``` -Add a build time dependency on the `gcc` crate with the following addition to +Add a build time dependency on the `cc` crate with the following addition to your `Cargo.toml`: ```toml [build-dependencies] -gcc = "0.3" +cc = "1.0" ``` -The [`gcc` crate](https://crates.io/crates/gcc) abstracts a range of build +The [`cc` crate](https://crates.io/crates/cc) abstracts a range of build script requirements for C code: * It invokes the appropriate compiler (MSVC for windows, `gcc` for MinGW, `cc` @@ -398,7 +400,7 @@ script requirements for C code: the compiler being used. * Other environment variables, such as `OPT_LEVEL`, `DEBUG`, etc., are all handled automatically. -* The stdout output and `OUT_DIR` locations are also handled by the `gcc` +* The stdout output and `OUT_DIR` locations are also handled by the `cc` library. Here we can start to see some of the major benefits of farming as much